<template>
  <div class="back flex" @click="goFront">
    <SvgIcon icon-class="roll_back" font-size="18px" class="mr6"/>
    <span>返回</span>
  </div>
</template>

<script setup lang="ts">
import { useChatBus } from '@/hook/useChatBus'
import { useMenuStore } from '@/stores/modules/menu'
import { useRouter } from 'vue-router'

const router = useRouter()
const menuStore = useMenuStore()
const bus = useChatBus(() => {})
const goFront = () => {
  menuStore.toggleIsInFront()
  bus.emit('setMenuList')
  router.push({ name: 'chatDefault' })
}
</script>

<style scoped>
.back {
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 24px;
}
</style>
